import Vue from 'vue'
import App from './App.vue'
import settings from '@/config/settings'

import 'normalize.css/normalize.css'
import '@/assets/theme/index.css'
import '@/assets/styles/index.scss'
import './assets/styles/tailwind.css'
// plugins
import ElementUI from 'element-ui'
import { Plugin as FragmentPlugin } from 'vue-fragment'
Vue.use(ElementUI)
Vue.use(FragmentPlugin)
// router
import router from './router'

// store
import store from './store'

// global directives
import setupDirectives from './directives'
setupDirectives()

// 挂载第三方库
import '@/core'

// icons
import './assets/icons'

// 全局路由拦截
import '@/permission'

// 全局组件注入
import '@/components'

// import ClientMonitor from 'skywalking-client-js'
// if (process.env.NODE_ENV !== 'development') {
//     ClientMonitor.register({
//         collector: window.api_source.skywalkingCollector,
//         service: window.api_source.skywalkingService,
//         serviceVersion: window.api_source.skywalkingserviceVersion,
//         pagePath: '/',
//         useFmp: true,
//         vue: Vue
//     })
// }
// 图片预览插件
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
Vue.use(Viewer, { defaultOptions: { zIndex: 9999 } })
Viewer.setDefaults({
    Options: {
        inline: true,
        button: true,
        navbar: true,
        title: true,
        toolbar: true,
        tooltip: true,
        movable: true,
        zoomable: true,
        rotatable: true,
        scalable: true,
        transition: true,
        fullscreen: true,
        keyboard: true,
        url: 'data-source'
    }
})

Vue.config.productionTip = false

window[settings.appId] = new Vue({
    data: {
        // 需要keep-alive的组件列表，列表内为组件name，此列表为动态控制
        keepAliveLists: [
            'PlanList',
            'TaskList',
            'FlawList',
            'HistoryList',
            'StatusAssessList',
            'Events',
            'BudgetingIndex',
            'RoadPlanIndex',
            'MaintenanceProjectIndex',
            'StandingBookIndex',
            'PlanMaintenanceIndex',
            'ContentList',
            'ManagementOfficeList',
            'SurveillanceCenterList',
            'TunnelStationList',
            'HighwayList',
            'MainTrunkList',
            'LineIntersectList',
            'SpecialLineList',
            'RoadSurfaceList',
            'RoadbedList',
            'HighwallList',
            'TunnelList',
            'BridgeList',
            'TunnelTraversalList',
            'CulvertList',
            'PerformancePredictionList',
            'IndoorDistributionList',
            'EmbankmentList',
            'StructureList',
            'DrainageFacilitiesList',
            'SignList',
            'ProtrudingSignpostList',
            'FenceList',
            'FenceNettingList',
            'OutlineMarkerList',
            'AntiglareShieldList',
            'BridgeFenceList',
            'MilepostList',
            'BoundaryMonumentList',
            'ParameterMaintenanceList',
            'DataAuditList',
            'ControlWorkOrderList',
            'FacilityList',
            'PoolList',
            'LaneList',
            'ParkingBeltList',
            'DailyMaintenanceTaskIndex',
            'CaseListIndex',
            'CompensationStatisticsIndex',
            'MaintenanceRecordManagementList',
            'ContractList',
            'ProjectLedgerList',
            'SummaryTableList',
            'MaintenanceProjectStatisticList'
        ]
    },
    render: h => h(App),
    router,
    store
}).$mount('#app')
